package com.tensquare.recruit.controller;

import com.tensquare.entity.Result;

import com.tensquare.entity.StatusCode;
import com.tensquare.recruit.pojo.Recruit;
import com.tensquare.recruit.service.RecruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zzb
 * @create 2021/2/21
 */
@RestController
@RequestMapping("recruit")
public class RecruitController {

    @Autowired
    private RecruitService recruitService;
    //推荐职位查询
    @GetMapping("search/recommend")
    public Result recommend(){
        List<Recruit> recruits = recruitService.recommend();
        System.out.println("recruits = " + recruits);
        return new Result(true, StatusCode.OK,"推荐职位查询成功",recruits);
    }

    //最新职位列表
    @GetMapping("search/newlist")
    public Result newList(){
        List<Recruit> recruits = recruitService.newlist();
        return new Result(true,StatusCode.OK,"查询最新职位列表成功",recruits);
    }
}
